<template>
  <div class="area-selection-box">
    <div class="selection-title">
      <span>确定区域方案</span>
    </div>
    <div class="selection-content">
      <div class="box-right">
        <div class="comput-times">
          <div class="times-title">
            <span>方案精度评定</span>
          </div>
        </div>
        <div class="table-box">
          <el-table border :data="state.tableData" :span-method="objectSpanMethod" size="mini">
            <el-table-column prop="city" label="方案名称" align="center" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="date" label="预报项目" align="center" show-overflow-tooltip>
            </el-table-column>
            <el-table-column label="预报方案精度" align="center">
              <el-table-column prop="province" label="总场次" align="center"> </el-table-column>
              <el-table-column prop="province" label="合格场次" align="center"> </el-table-column>
              <el-table-column prop="province1" label="合格率(%)" align="center"> </el-table-column>
              <el-table-column prop="name" label="等级" align="center"> </el-table-column>
            </el-table-column>
            <!-- <el-table-column label="操作"   align="center" width="150px">
                          <template slot-scope="scope">
                            <el-button
                            type="primary"
                              size="mini"
                              @click.stop="handleEdit(scope.$index, scope.row)">查看参数详情</el-button>
                          </template>
                        </el-table-column> -->
          </el-table>
        </div>
        <div class="comput-times">
          <div class="times-title">
            <span>方案时效评定</span>
          </div>
        </div>
        <div class="table-time">
          <el-table :data="tableData" highlight-current-row size="small" empty-text="暂无数据">
            <el-table-column prop="date" label="方案名称" align="center" show-overflow-tooltip />
            <el-table-column prop="name" label="计算总场次" align="center" show-overflow-tooltip />
            <el-table-column prop="address" label="成功场次" align="center" show-overflow-tooltip />
            <el-table-column prop="date" label="成功率(%)" align="center" show-overflow-tooltip />
            <el-table-column prop="name" label="最大耗时" align="center" show-overflow-tooltip />
            <el-table-column prop="address" label="最小耗时" align="center" show-overflow-tooltip />
            <el-table-column prop="date" label="平均耗时" align="center" show-overflow-tooltip />
            <el-table-column prop="name" label="耗时要求" align="center" show-overflow-tooltip />
            <el-table-column prop="address" label="评定等级" align="center" show-overflow-tooltip />
          </el-table>
        </div>
      </div>
      <div class="schemetype-list">
        <div class="scheme-title">
          <span>选择确定方案</span>
        </div>
        <div class="schemes">
          <div :class="['scheme-name', currentTab == index ? 'active' : '']" :key="index"
            v-for="(item, index) in state.schemeList" @click="clickTabs(index)">
            <span>{{ item.name }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref, reactive } from 'vue'
const state = reactive({
  schemeList: [
    {
      id: 1,
      name: '时空变源+1维'
    },
    {
      id: 2,
      name: '新安江+1维'
    }
  ],
  tableData: [
    {
      date: '洪峰',
      name: '甲',
      province: '18',
      province1: '78',
      city: '新安江+1维',
      address: '18市普陀区金沙江路 1518 弄',
      zip: 200333
    },
    {
      date: '洪量',
      name: '甲',
      province: '18',
      province1: '88',
      city: '莱芜',
      address: '18市普陀区金沙江路 1518 弄',
      zip: 200333
    },
    {
      date: '洪峰、洪量',
      name: '甲',
      province: '18',
      province1: '78',
      city: '莱芜',
      address: '18市普陀区金沙江路 1518 弄',
      zip: 200333
    },
    {
      date: '洪峰、洪量、峰现时间',
      name: '甲',
      province: '18',
      province1: '88',
      city: '莱芜',
      address: '18市普陀区金沙江路 1518 弄',
      zip: 200333
    }
  ]
})
const objectSpanMethod = ({ row, column, rowIndex, columnIndex }) => {
  if (columnIndex === 0) {
    if (rowIndex % 4 === 0) {
      return {
        rowspan: 4,
        colspan: 1
      }
    } else {
      return {
        rowspan: 0,
        colspan: 0
      }
    }
  }
}
const currentTab = ref(0)
function clickTabs(index) {
  currentTab.value = index
}
</script>
<style lang="less" scoped>
.area-selection-box {
  width: 100%;
  height: 100%;
  .selection-title {
    height: 30px;
    margin-left: 20px;
    span {
      color: #5583e6;
      font-size: 16px;
    }
  }
  .selection-content {
    height: 500px;
    overflow-y: auto;
    box-sizing: border-box;
    // padding-left: 50px;

    .box-right {
      width: 100%;
      .comput-times {
        height: 35px;
        display: flex;
        margin-left: 20px;
        align-items: center;
        .times-title {
          height: 20px;
          span {
            font-weight: 600;
          }
        }
      }
      .table-box {
        width: 100%;
        :deep(.el-table) {
          font-size: 12px;
          th {
            padding: 0;
          }
          td {
            padding: 0;
          }
        }
      }
      .table-time {
        // width: 550px;
      }
    }
    .schemetype-list {
      .scheme-title {
        margin-left: 20px;
        margin-top: 10px;
        span {
          font-weight: 600;
        }
      }
      .schemes {
        display: flex;
        margin-top: 30px;
        .scheme-name {
          width: 150px;
          height: 40px;
          border: 1px solid black;
          background: white;
          display: flex;
          justify-content: center;
          align-items: center;
          margin-right: 50px;
          cursor: pointer;
          &.active {
            background: #63b6e0;
            span {
              color: white;
            }
          }
          span {
            color: black;
          }
        }
      }
    }
  }
}
</style>
